package com.adabank.controller;

import lombok.Data;

@Data

public class Controller<S> {

    public String status;
    public String message;
    public S data;

    public Controller() {
    }

    public static <S> Controller<S> of(S data) {
        Controller controller = new Controller();
        controller.data = data;
        controller.status = "OK";
        controller.message = null;
        return controller;
    }

    public static <S> Controller<S> oof(String status, String message, S data) {
        Controller controller = new Controller();
        controller.status = status;
        controller.message = message;
        controller.data = data;
        return controller;
    }

}
